﻿using System;
using System.Windows.Forms;

namespace OS_pre {
	public partial class ParameterSetting : Form {
        public int consumer_num, producer_num, buffer_v, produce_time, consume_time;
        // public bool pro_t_rand, con_t_rand;
		public ParameterSetting() {
			InitializeComponent();
		}

		// private void ConsumeRand_CheckedChanged(object sender, EventArgs e) {
		// 	ConsumeTime.Enabled = !ConsumeRand.Checked;
		// }
		//
		// private void ProduceRand_CheckedChanged(object sender, EventArgs e) {
		// 	ProduceTime.Enabled = !ProduceRand.Checked;
		// }

		private void ParameterCommit_Click(object sender, EventArgs e) {
            consumer_num = ConsumerNum.Value;
            producer_num = ProducerNum.Value;
            buffer_v = BufferMax.Value;
            produce_time = ProduceTime.Value;
            consume_time = ConsumeTime.Value;
            // pro_t_rand = ProduceRand.Checked;
            // con_t_rand = ConsumeRand.Checked;
            Close();
		}

		private void BufferMax_Scroll(object sender, EventArgs e) {
			BufferValue.Text = BufferMax.Value.ToString();
		}

		private void ProduceTime_Scroll(object sender, EventArgs e) {
			ProcduceTimeValue.Text = ProduceTime.Value.ToString();
		}

		private void ConsumeTime_Scroll(object sender, EventArgs e) {
			ConsumeTimeValue.Text = ConsumeTime.Value.ToString();
		}

		private void ProducerNum_Scroll_1(object sender, EventArgs e) {
			ProducerNumView.Text = ProducerNum.Value.ToString();
		}

		private void ConsumerNum_Scroll(object sender, EventArgs e) {
			ConsumerNumView.Text = ConsumerNum.Value.ToString();
		}

        private void ParameterSetting_Load(object sender, EventArgs e)
        {

        }
    }
}